<?php
if(isset($_REQUEST['hdn_page'])){
	$v_page=intval($_REQUEST['hdn_page']);
}else{
	$v_page=1;
}
//Kiem tra quyen xoa cau hoi 
$function_code = _CONST_ONEGATE_QA_DELETE;
if(!_check_permission_on_function($_SESSION['staff_id'], $_ISA_APP_CODE, $function_code)){?>
	<script>
		alert("<? echo _CONST_FUNCTION_PERMISSION_ERROR; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<? echo $v_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?
	exit;
}
$v_cate_id = 0;
if(isset($_REQUEST['hdn_cate_id'])){
	$v_cate_id = intval($_REQUEST['hdn_cate_id']);
}
$v_cate = "";
if(isset($_REQUEST['hdn_cate'])){
	$v_cate = $_REQUEST['hdn_cate'];
} 
$v_agency_id = 0;
if(isset($_REQUEST['hdn_agency_id'])){
	$v_agency_id = intval($_REQUEST['hdn_agency_id']);
}
$v_agency = "";
if(isset($_REQUEST['hdn_agency'])){
	$v_agency = $_REQUEST['hdn_agency'];
}
$v_filter = "";
if(isset($_REQUEST['hdn_filter'])){
	$v_filter = _replace_bad_char($_REQUEST['hdn_filter']);
} 
$v_status = -1;
if(isset($_REQUEST['hdn_status'])){	
	$v_status = $_REQUEST['hdn_status'];
}
//Lay cac thong tin ve trang thai cua trang
$v_top_id  =   0;
if(isset($_REQUEST['hdn_top_id'])){
	$v_top_id = intval($_REQUEST['hdn_top_id']);
} 
$v_bottom_id = 0;
if(isset($_REQUEST['hdn_bottom_id'])){
	$v_bottom_id = intval($_REQUEST['hdn_bottom_id']);
} 
$v_exception_qa_id  = 0;
if(isset($_REQUEST['hdn_exception_qa_id'])){
	$v_exception_qa_id = intval($_REQUEST['hdn_exception_qa_id']);
}
$v_direction  = 'TOP';
if(isset($_REQUEST['hdn_direction'])){
	$v_direction = $_REQUEST['hdn_direction'];
}
// Danh sach cac cau hoi can xoa
$v_list_onegate_qa_id = $_REQUEST['hdn_list_onegate_qa_id'];
if(_is_sqlserver()){
	$sql = "Onegate_QAQuestionDelete '" . $v_list_onegate_qa_id . "'" ;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$rs = $ado_conn->GetRow($sql); 
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
}
if (!is_null($v_error) and $v_error<>""){?>
	<script>
		alert("<? echo $v_error; ?>");
		window.history.back();
	</script><?php
	exit;
}?>
<form action="index.php" name="f_back" method="post">
	<input type="hidden" name="fuseaction" value="DISPLAY_ALL_QA_QUESTION">
	<input type="hidden" name="hdn_filter" value="<?php echo $v_filter; ?>">
	<input type="hidden" name="hdn_cate" value="<?php echo $v_cate;?>">
	<input type="hidden" name="hdn_status" value="<?php echo $v_status; ?>">
	<input type="hidden" name="hdn_cate_id" value="<?php echo $v_cate_id;?>">
	<input type="hidden" name="hdn_agency" value="<?php echo $v_agency;?>">
	<input type="hidden" name="hdn_agency_id" value="<?php echo $v_agency_id;?>">
	<input type="hidden" name="hdn_qa_question_cate_id" value="<?php echo $v_qa_question_cate_id;?>">
	<input type="hidden" name="hdn_top_id" value="<?php echo $v_top_id; ?>">
	<input type="hidden" name="hdn_bottom_id" value="<?php echo $v_bottom_id ?>">
	<input type="hidden" name="hdn_direction" value="<?php echo $v_direction; ?>">
	<input type="hidden" name="hdn_exception_qa_id" value="<?php echo $v_exception_qa_id; ?>">
	<input type="hidden" name="hdn_page" value="<?php echo $v_page;?>">
</form>		
<Script language="javascript">	
	document.forms(0).submit();
</Script> 


